home *** CD-ROM | disk | FTP | other *** search
/ Delphi 5 for Professionals / DELPHI5.iso / AddOns / Components / Orpheus v3.02 / SETUP.EXE / %MAINDIR% / ovcdata.pas < prev    next >
Encoding:
Pascal/Delphi Source File  |  1999-02-25  |  24.3 KB  |  641 lines

  1. {*********************************************************}
  2. {*                   OVCDATA.PAS 3.00                    *}
  3. {*     Copyright (c) 1995-99 TurboPower Software Co      *}
  4. {*                 All rights reserved.                  *}
  5. {*********************************************************}
  6.  
  7. {$I OVC.INC}
  8.  
  9. {$B-} {Complete Boolean Evaluation}
  10. {$I+} {Input/Output-Checking}
  11. {$P+} {Open Parameters}
  12. {$T-} {Typed @ Operator}
  13. {$W-} {Windows Stack Frame}
  14. {$X+} {Extended Syntax}
  15.  
  16. {$IFNDEF Win32}
  17. {$G+} {286 Instructions}
  18. {$N+} {Numeric Coprocessor}
  19.  
  20. {$C MOVEABLE,DEMANDLOAD,DISCARDABLE}
  21. {$ENDIF}
  22.  
  23. unit OvcData;
  24.   {-Miscellaneous type and constant declarations}
  25.  
  26. interface
  27.  
  28. uses
  29.   {$IFDEF Win32} Windows, {$ELSE} WinTypes, WinProcs, {$ENDIF}
  30.   Controls, Forms, Graphics, Messages, StdCtrls, SysUtils,
  31.   OvcConst, OvcDate, OvcSrMgr;
  32.  
  33. const
  34.   BorderStyles    : array[TBorderStyle] of LongInt =
  35.                     (0, WS_BORDER);
  36.   ScrollBarStyles : array [TScrollStyle] of LongInt =
  37.                     (0, WS_HSCROLL, WS_VSCROLL, WS_HSCROLL or WS_VSCROLL);
  38.  
  39. {$IFNDEF Win32}
  40. type
  41.   AnsiChar      = Char;
  42.   PAnsiChar     = PChar;
  43.   AnsiString    = string;
  44.   PAnsiString   = ^string;
  45.   ShortString   = string;
  46.   DWord         = LongInt;
  47. {$ENDIF}
  48.  
  49. {$IFNDEF VERSION3}
  50. type
  51.   TCustomForm   = TForm;
  52. const
  53.   WM_MOUSEWHEEL = $020A;
  54.   WHEEL_DELTA   = 120;
  55. {$ENDIF}
  56. {$IFNDEF VERSION4}
  57. type
  58.   PDateTime     = ^TDateTime;
  59. {$ENDIF}
  60.  
  61. {some colors that are not defined by Delphi}
  62. const
  63.   {$IFNDEF WIN32}
  64.   clInfoBk     = TColor($E1FFFF);
  65.   clNone       = TColor($2FFFFFF);
  66.   {$ENDIF}
  67.   clCream      = TColor($A6CAF0);
  68.   clMoneyGreen = TColor($C0DCC0);
  69.   clSkyBlue    = TColor($FFFBF0);
  70.  
  71. type
  72.   TCharSet = set of AnsiChar; {a Pascal set of characters}
  73.  
  74. type
  75.   {general string types}
  76.   TPathStr = string[79];
  77.   TFileStr = string[8];
  78.   TExtStr  = string[3];
  79.  
  80. type
  81.   PPointer = ^Pointer;
  82.  
  83. type
  84.   {secondary field options--internal}
  85.   TsefOption = (
  86.     sefValPending,      {field needs validation}
  87.     sefInvalid,         {field is invalid}
  88.     sefNoHighlight,     {Don't highlight field initially}
  89.     sefIgnoreFocus,     {We're ignoring the focus}
  90.     sefValidating,      {We're validating a field}
  91.     sefModified,        {Field recently modified}
  92.     sefEverModified,    {Field has been modified after last data transfer}
  93.     sefFixSemiLits,     {Semi-literals were stripped}
  94.     sefHexadecimal,     {Field's value is shown in hex}
  95.     sefOctal,           {Field's value is shown in octal}
  96.     sefBinary,          {Field's value is shown in binary}
  97.     sefNumeric,         {Edit from right to left--for numbers only}
  98.     sefRealVar,         {Field is of a real/8087 type}
  99.     sefNoLiterals,      {Picture mask has no literals}
  100.     sefHaveFocus,       {Control has the focus}
  101.     sefRetainPos,       {Retain caret position}
  102.     sefErrorPending,    {Error pending?}
  103.     sefInsert,          {Insert mode on}
  104.     sefLiteral,         {Next char is literal}
  105.     sefAcceptChar,      {Accept next character}
  106.     sefCharOK,          {OK to add a character}
  107.     sefUpdating,        {field is being updated}
  108.     sefGettingValue,    {field contents are being retrieved}
  109.     sefUserValidating,  {user validation in progress}
  110.     sefNoUserValidate); {don't perform user validation}
  111.  
  112.   {Set of current secondary options for entry fields}
  113.   TsefOptionSet = set of TsefOption;
  114.  
  115. const
  116.   {default secondary field options}
  117.   sefDefOptions      : TsefOptionSet = [sefCharOK, sefInsert];
  118.  
  119. const
  120.   DefPadChar         = ' '; {Default character used to pad the end of a display string}
  121.   MaxEditLen         = 255; {Maximum length of edit string}
  122.   MaxPicture         = 255; {Maximum length of a picture mask}
  123.  
  124. {*** Picture masks ***}
  125. const
  126.   {the following characters are meaningful in Picture masks}
  127.   pmAnyChar     = 'X';         {allows any character}
  128.   pmForceUpper  = '!';         {allows any character, forces upper case}
  129.   pmForceLower  = 'L';         {allows any character, forces lower case}
  130.   pmForceMixed  = 'x';         {allows any character, forces mixed case}
  131.   pmAlpha       = 'a';         {allows alphas only}
  132.   pmUpperAlpha  = 'A';         {allows alphas only, forces upper case}
  133.   pmLowerAlpha  = 'l';         {allows alphas only, forces lower case}
  134.   pmPositive    = '9';         {allows numbers and spaces only}
  135.   pmWhole       = 'i';         {allows numbers, spaces, minus}
  136.   pmDecimal     = '#';         {allows numbers, spaces, minus, period}
  137.   pmScientific  = 'E';         {allows numbers, spaces, minus, period, 'e'}
  138.   pmHexadecimal = 'K';         {allows 0-9, A-F, and space forces upper case}
  139.   pmOctal       = 'O';         {allows 0-7, space}
  140.   pmBinary      = 'b';         {allows 0-1, space}
  141.   pmTrueFalse   = 'B';         {allows T, t, F, f}
  142.   pmYesNo       = 'Y';         {allows Y, y, N, n}
  143.  
  144.   pmUser1       = '1';         {User-defined picture mask characters}
  145.   pmUser2       = '2';
  146.   pmUser3       = '3';
  147.   pmUser4       = '4';
  148.   pmUser5       = '5';
  149.   pmUser6       = '6';
  150.   pmUser7       = '7';
  151.   pmUser8       = '8';
  152.  
  153.   Subst1        = #241;        {User-defined substitution characters}
  154.   Subst2        = #242;
  155.   Subst3        = #243;
  156.   Subst4        = #244;
  157.   Subst5        = #245;
  158.   Subst6        = #246;
  159.   Subst7        = #247;
  160.   Subst8        = #248;
  161.  
  162. const
  163.   {Other special characters allowed in Picture strings}
  164.   pmDecimalPt   = '.';         {insert decimal point}
  165.   pmComma       = ',';         {character used to separate numbers}
  166.   pmFloatDollar = '$';         {floating dollar sign}
  167.   pmCurrencyLt  = 'c';         {currency to left of the amount}
  168.   pmCurrencyRt  = 'C';         {currency to right of the amount}
  169.   pmNegParens   = 'p';         {indicates () should be used for negative #'s}
  170.   pmNegHere     = 'g';         {placeholder for minus sign}
  171.   {NOTE: Comma and FloatDollar are allowed only in fields containing fixed
  172.    decimal points and/or numeric fields. NegParens and NegHere should be used
  173.    only in numeric fields.}
  174.  
  175. const
  176.   {the following characters are meaningful in date Picture masks}
  177.   pmMonth  = 'm';  {formatting character for a date string picture mask}
  178.   pmMonthU = 'M';  {formatting character for a date string picture mask.
  179.                     Uppercase means pad with ' ' rather than '0'}
  180.   pmDay    = 'd';  {formatting character for a date string picture mask}
  181.   pmDayU   = 'D';  {formatting character for a date string picture mask.
  182.                     Uppercase means pad with ' ' rather then '0'}
  183.   pmYear   = 'y';  {formatting character for a date string picture mask}
  184.   pmDateSlash  = '/';  {formatting character for a date string picture mask}
  185.  
  186.   {'n'/'N' may be used in place of 'm'/'M' when the name of the month is
  187.    desired instead of its number. E.g., 'dd/nnn/yyyy' -\> '01-Jan-1980'.
  188.    'dd/NNN/yyyy' -\> '01-JAN-1980' (if SlashChar = '-'). The abbreviation used
  189.    is based on the width of the subfield (3 in the example) and the current
  190.    contents of the MonthString array.}
  191.   pmMonthName   = 'n';  {formatting character for a date string picture mask}
  192.   pmMonthNameU  = 'N';  {formatting character for a date string picture mask.
  193.                         Uppercase causes the output to be in uppercase}
  194.  
  195.   {'w'/'W' may be used to include the day of the week in a date string. E.g.,
  196.   'www dd nnn yyyy' -\> 'Mon 01 Jan 1989'. The abbreviation used is based on
  197.   the width of the subfield (3 in the example) and the current contents of the
  198.   DayString array. Note that entry field will not allow the user to enter
  199.   text into a subfield containing 'w' or 'W'. The day of the week will be
  200.   supplied automatically when a valid date is entered.}
  201.   pmWeekDay  = 'w';   {formatting character for a date string picture mask}
  202.   pmWeekDayU = 'W';   {formatting character for a date string picture mask.
  203.                        Uppercase causes the output to be in uppercase}
  204.  
  205.   pmLongDateSub1 = 'f';   {mask character used with Window's long date format}
  206.   pmLongDateSub2 = 'g';   {mask character used with Window's long date format}
  207.   pmLongDateSub3 = 'h';   {mask character used with Window's long date format}
  208.  
  209. const
  210.   {if uppercase letters are used, numbers are padded with ' ' rather than '0'}
  211.   pmHour     = 'h';   {formatting character for a time string picture mask}
  212.   pmHourU    = 'H';   {formatting character for a time string picture mask}
  213.   pmMinute   = 'm';   {formatting character for a time string picture mask}
  214.   pmMinuteU  = 'M';   {formatting character for a time string picture mask}
  215.   pmSecond   = 's';   {formatting character for a time string picture mask}
  216.   pmSecondU  = 'S';   {formatting character for a time string picture mask}
  217.   {'hh:mm:ss tt' -\> '12:00:00 pm', 'hh:mmt' -\> '12:00p'}
  218.   pmAmPm      = 't';  {formatting character for a time string picture mask.
  219.                       This generates 'AM' or 'PM'}
  220.   pmTimeColon = ':';  {formatting character for a time string picture mask}
  221.  
  222. const
  223.   PictureChars : TCharSet = [
  224.     pmAnyChar, pmForceUpper, pmForceLower, pmForceMixed,
  225.     pmAlpha, pmUpperAlpha, pmLowerAlpha,
  226.     pmPositive, pmWhole, pmDecimal, pmScientific,
  227.     pmHexadecimal, pmOctal, pmBinary,
  228.     pmTrueFalse, pmYesNo,
  229.     pmMonthName, pmMonthNameU, pmMonth,
  230.     pmMonthU, pmDay, pmDayU, pmYear, pmHour, pmHourU, pmMinute,
  231.     pmMinuteU, pmSecond, pmSecondU, pmAmPm, pmUser1..pmUser8];
  232.  
  233. const
  234.   {set of allowable picture characters for simple fields}
  235.   SimplePictureChars : TCharSet = [
  236.     pmAnyChar, pmForceUpper, pmForceLower, pmForceMixed,
  237.     pmAlpha, pmUpperAlpha, pmLowerAlpha,
  238.     pmPositive, pmWhole, pmDecimal, pmScientific,
  239.     pmHexadecimal, pmOctal, pmBinary,
  240.     pmTrueFalse, pmYesNo,
  241.     pmUser1..pmUser8];
  242.  
  243. type
  244.   {types of case change operations associated with a picture mask character}
  245.   TCaseChange = (mcNoChange, mcUpperCase, mcLowerCase, mcMixedCase);
  246.  
  247. type
  248.   TUserSetRange   = pmUser1..pmUser8;
  249.   TForceCaseRange = pmUser1..pmUser8;
  250.   TSubstCharRange = Subst1..Subst8;
  251.  
  252.   TUserCharSets   = array[TUserSetRange] of TCharSet;
  253.   TForceCase      = array[TForceCaseRange] of TCaseChange;
  254.   TSubstChars     = array[TSubstCharRange] of AnsiChar;
  255.  
  256. const
  257.   MaxDateLen     = 40;        {maximum length of date picture strings}
  258.   MaxMonthName   = 15;        {maximum length for month names}
  259.   MaxDayName     = 15;        {maximum length for day names}
  260.  
  261. const
  262.   otf_SizeData = 0; {These three constants are used in data transfers to}
  263.   otf_GetData  = 1; {specify the type of transfer operation being requested}
  264.   otf_SetData  = 2;
  265.  
  266. type
  267.   TEditString  = array[0..MaxEditLen] of AnsiChar;
  268.   TPictureMask = array[0..MaxPicture] of AnsiChar;
  269.  
  270.   {An array of flags that indicate the type of mask character at a given
  271.    location in a picture mask}
  272.   TPictureFlags = array[0..MaxEditLen+1] of Byte;
  273.  
  274.   {Each entry field maintains two data structures of this type, one to store
  275.    the lower limit of a field's value, and another to store the upper limit}
  276.   PRangeType = ^TRangeType;
  277.   TRangeType = packed record
  278.     case Byte of                         {size}
  279.     00 : (rtChar : AnsiChar);             {01}
  280.     01 : (rtByte : Byte);                 {01}
  281.     02 : (rtSht  : ShortInt);             {01}
  282.     03 : (rtInt  : SmallInt);             {02}
  283.     04 : (rtWord : Word);                 {02}
  284.     05 : (rtLong : LongInt);              {04}
  285.     06 : (rtSgl  : Single);               {04}
  286.     07 : (rtPtr  : Pointer);              {04}
  287.     {$IFDEF CBuilder}
  288.     08 : (rtReal : Double);               {06}
  289.     {$ELSE}
  290.     08 : (rtReal : Real);                 {06}
  291.     {$ENDIF CBuilder}
  292.     09 : (rtDbl  : Double);               {08}
  293.     {$IFDEF CBuilder}
  294.     10 : (rtComp : Double);               {08}
  295.     {$ELSE}
  296.     10 : (rtComp : Comp);                 {08}
  297.     {$ENDIF CBuilder}
  298.     11 : (rtExt  : Extended);             {10}
  299.     12 : (rtDate : LongInt);              {04}
  300.     13 : (rtTime : LongInt);              {04}
  301.     14 : (rt10   : array[1..10] of Byte); {10} {forces structure to size of 10 bytes}
  302.   end;
  303.  
  304. const
  305.   BlankRange : TRangeType = (rt10 : (0, 0, 0, 0, 0, 0, 0, 0, 0, 0));
  306.  
  307. {*** Date/Time declarations ***}
  308. type
  309.   TOvcDate  = TStDate;
  310.   TOvcTime  = TStTime;
  311.   TDayType = TStDayType;
  312.  
  313. type
  314.   {states for data aware entry fields}
  315.   TDbEntryFieldStates = (esFocused, esSelected, esReset);
  316.   TDbEntryFieldState  = set of TDbEntryFieldStates;
  317.  
  318. type
  319.   {Search option flags for editor and viewer}
  320.   TSearchOptions = (
  321.      soFind,        {find  (this option is assumed)        }
  322.      soBackward,    {search backwards                      }
  323.      soMatchCase,   {don't ignore case when searching      }
  324.      soGlobal,      {search globally                       }
  325.      soReplace,     {find and replace         (editor only)}
  326.      soReplaceAll,  {find and replace all     (editor only)}
  327.      soWholeWord,   {match on whole word only (editor only)}
  328.      soSelText);    {search in selected text  (editor only)}
  329.   TSearchOptionSet = set of TSearchOptions;
  330.  
  331. const
  332.   {maximum length of a search/replacement string}
  333.   MaxSearchString = 255;
  334.  
  335. type
  336.   {types of tabs supported in the editor}
  337.   TTabType   = (ttReal, ttFixed, ttSmart);
  338.  
  339.   {entry field flag for display of number field with zero value}
  340.   TZeroDisplay = (zdShow, zdHide, zdHideUntilModified);
  341.  
  342. type
  343.   {structrue of the commands stored in the command table}
  344.   POvcCmdRec = ^TOvcCmdRec;
  345.   TOvcCmdRec = packed record
  346.     case Byte of
  347.       0 : (Key1  : Byte;     {first keys' virtual key code}
  348.            SS1   : Byte;     {shift state of first key}
  349.            Key2  : Byte;     {second keys' virtual key code, if any}
  350.            SS2   : Byte;     {shift state of second key}
  351.            Cmd   : Word);    {command to return for this entry}
  352.       1 : (Keys  : LongInt); {used for sorting, searching, and storing}
  353.   end;
  354.  
  355. const
  356.   {shift state flags for command processors}
  357.   ss_None     = $00; {no shift key is pressed}
  358.   ss_Shift    = $02; {the shift key is pressed}
  359.   ss_Ctrl     = $04; {the control key is pressed}
  360.   ss_Alt      = $08; {the alt key is pressed}
  361.   ss_Wordstar = $80; {2nd key of a twokey wordstar command: ss_Ctrl or ss_None}
  362.     {the second key of a two-key wordstar command is accepted if}
  363.     {pressed by itself of with the ctrl key. case is ignored}
  364.  
  365. const
  366.   {virtual key constants not already defined}
  367.   VK_NONE = 0;
  368.   VK_ALT  = VK_MENU;
  369.   VK_A = Ord('A');  VK_B = Ord('B');  VK_C = Ord('C'); VK_D = Ord('D');
  370.   VK_E = Ord('E');  VK_F = Ord('F');  VK_G = Ord('G');  VK_H = Ord('H');
  371.   VK_I = Ord('I');  VK_J = Ord('J');  VK_K = Ord('K');  VK_L = Ord('L');
  372.   VK_M = Ord('M');  VK_N = Ord('N');  VK_O = Ord('O');  VK_P = Ord('P');
  373.   VK_Q = Ord('Q');  VK_R = Ord('R');  VK_S = Ord('S');  VK_T = Ord('T');
  374.   VK_U = Ord('U');  VK_V = Ord('V');  VK_W = Ord('W');  VK_X = Ord('X');
  375.   VK_Y = Ord('Y');  VK_Z = Ord('Z');  VK_0 = Ord('0');  VK_1 = Ord('1');
  376.   VK_2 = Ord('2');  VK_3 = Ord('3');  VK_4 = Ord('4');  VK_5 = Ord('5');
  377.   VK_6 = Ord('6');  VK_7 = Ord('7');  VK_8 = Ord('8');  VK_9 = Ord('9');
  378.  
  379. var
  380.   AlphaCharSet  : TCharSet;
  381.  
  382. const
  383.   IntegerCharSet: TCharSet = ['0'..'9', ' '];
  384.   RealCharSet   : TCharSet = ['0'..'9', ' ', '-', '.'];
  385.  
  386. const
  387.   {Picture flag values for elements in a TPictureFlags array}
  388.   pflagLiteral = 0;  {Corresponding char in the mask is a literal}
  389.   pflagFormat  = 1;  {Corresponding char in the mask is a formatting character}
  390.   pflagSemiLit = 2;  {Corresponding char in the mask is a semi-literal character}
  391.  
  392. const
  393.   {------------------- Windows messages -----------------------}
  394.   {Not a message code. Value of the first of the message codes used}
  395.   OM_FIRST = $7F00; {***}
  396.  
  397.   {entry field error}
  398.   OM_REPORTERROR         = OM_FIRST + 0;
  399.     {messages for/from viewer/editor controls}
  400.   OM_SETFOCUS            = OM_FIRST + 1;
  401.     {sent by an entry field to the controller to request return of the
  402.     focus. lParam is pointer of the object to return the focus to}
  403.   OM_SHOWSTATUS          = OM_FIRST + 2;
  404.     {sent by a viewer or editor control to itself when the caret moves, or
  405.     when text is inserted or deleted. wParam is the current column (an
  406.     effective column number), and lParam is the current line}
  407.   OM_GETDATASIZE         = OM_FIRST + 3;
  408.     {sent to an entry field to obtain its data size}
  409.   OM_RECREATEWND         = OM_FIRST + 5;
  410.     {sent to force a call to RecreateWnd}
  411.   OM_PREEDIT             = OM_FIRST + 6;
  412.     {sent to preform pre-edit notification for entry fields}
  413.   OM_POSTEDIT            = OM_FIRST + 7;
  414.     {sent to preform post-edit notification for entry fields}
  415.   OM_AFTERENTER          = OM_FIRST + 8;
  416.     {sent to preform after-enter notification}
  417.   OM_AFTEREXIT           = OM_FIRST + 9;
  418.     {sent to preform after-exit notification}
  419.   OM_DELAYNOTIFY         = OM_FIRST + 10;
  420.     {sent to preform delayed notification}
  421.   OM_POSITIONLABEL       = OM_FIRST + 11;
  422.     {sent to cause the label to be repositioned}
  423.   OM_RECORDLABELPOSITION = OM_FIRST + 12;
  424.     {sent to cause the current position of the label to be recorded}
  425.   OM_ASSIGNLABEL         = OM_FIRST + 13;
  426.     {sent to assign a albel to a control}
  427.   OM_FONTUPDATEPREVIEW   = OM_FIRST + 14;
  428.     {sent to postpone the font change of the preview control}
  429.   OM_DESTROYHOOK         = OM_FIRST + 15;
  430.     {send to cause the window hook to be destroyed}
  431.   OM_PROPCHANGE          = OM_FIRST + 16;
  432.     {sent by a collection to its property editor when a property is changed}
  433.   OM_ISATTACHED          = OM_FIRST + 17;
  434.     {sent to other controls to see if they are attached. Used by
  435.      attached button components. Result is LongInt(Self) if true}
  436.  
  437. {message crackers for the above Orpheus messages}
  438. type
  439.   TOMReportError = record
  440.     Msg    : Cardinal;
  441.     Error  : Word;
  442.     {$IFDEF Win32}
  443.     Unused : Word;
  444.     {$ENDIF}
  445.     lParam : LongInt;
  446.     Result : LongInt;
  447.   end;
  448.  
  449.   TOMSetFocus = record
  450.     Msg    : Cardinal;
  451.     wParam : Integer;
  452.     Control: TWinControl;
  453.     Result : LongInt;
  454.   end;
  455.  
  456.   TOMShowStatus = record
  457.     Msg    : Cardinal;
  458.     Column : Integer;
  459.     Line   : LongInt;
  460.     Result : LongInt;
  461.   end;
  462.  
  463. type
  464.   TShowStatusEvent =
  465.     procedure(Sender : TObject; LineNum : LongInt; ColNum : Integer)
  466.     of object;
  467.     {-event to notify of a viewer or editor caret position change}
  468.  
  469.   TTopLineChangedEvent =
  470.     procedure(Sender : TObject; Line : LongInt)
  471.     of object;
  472.     {-event to notify when the top line changes for the editor or viewer}
  473.  
  474. const
  475.   {*** Error message codes ***}
  476.   oeFirst             = 256; {***}
  477.  
  478.   oeRangeError        = oeFirst+0;
  479.     {This error occurs when a user enters a value that is not within the
  480.     accepted range of values for the field}
  481.   oeInvalidNumber     = oeFirst+1;
  482.     {This error is reported if the user enters a string that does not represent
  483.     a number in a field that should contain a numeric value}
  484.   oeRequiredField     = oeFirst+2;
  485.     {This error occurs when the user leaves blank a field that is marked as
  486.     required}
  487.   oeInvalidDate       = oeFirst+3;
  488.     {This error occurs when the user enters a value in a date field that does
  489.     not represent a valid date}
  490.   oeInvalidTime       = oeFirst+4;
  491.     {This error occurs when the user enters a value in a time field that does
  492.     not represent a valid time of day}
  493.   oeBlanksInField     = oeFirst+5;
  494.     {This error is reported only by the validation helper routines
  495.     ValidateNoBlanks and ValidateSubfields. It indicates that a blank was left
  496.     in a field or subfield in which no blanks are allowed}
  497.   oePartialEntry      = oeFirst+6;
  498.     {This error is reported only by the validation helper routines
  499.     ValidateNotPartial and ValidateSubfields in OODEWCC. It indicates that a
  500.     partial entry was given in a field or subfield in which the field/subfield
  501.     must be either entirely empty or entirely full}
  502.   oeOutOfMemory       = oeFirst+7;
  503.     {This error is reported by a viewer or editor control when there is
  504.     insufficient memory to perform the requested operation. A viewer control
  505.     reports this error only when copying selected text to the clipboard}
  506.   oeRegionSize        = oeFirst+8;
  507.     {This error is reported by an editor control when the user asks to
  508.     copy selected text to the clipboard, and the selected region exceeds
  509.     64K in size}
  510.   oeTooManyParas      = oeFirst+9;
  511.     {This error is reported by an editor control when the limit on the number
  512.     of paragraphs is reached, and the requested operation would cause it to be
  513.     exceeded}
  514.   oeCannotJoin        = oeFirst+10;
  515.     {This error is reported by an editor control when the user attempts to join
  516.     two paragraphs that cannot be joined. Typically this occurs when joining
  517.     the two paragraphs would cause the new paragraph to exceed its size limit}
  518.   oeTooManyBytes      = oeFirst+11;
  519.     {This error is reported by an editor control when the limit on the total
  520.     number of bytes is reached, and the requested operation would cause it to
  521.     be exceeded}
  522.   oeParaTooLong       = oeFirst+12;
  523.     {This error is reported by an editor control when the limit on the length
  524.     of an individual paragraph is reached, and the requested operation would
  525.     cause it to be exceeded}
  526.   oeCustomError       = 32768;
  527.     {the first error code reserved for user applications. All }
  528.     {error values less than this value are reserved for use by}
  529.     {Orpheus}
  530.  
  531. {*** Field class and type constant id's ***}
  532.  
  533. const
  534.   {Field class codes}
  535.   fcSimple     =  0;
  536.   fcPicture    =  1;
  537.   fcNumeric    =  2;
  538.  
  539.   {Field class divisor}
  540.   fcpDivisor   = $40;
  541.  
  542.   {Field class prefixes}
  543.   fcpSimple    = fcpDivisor*fcSimple;
  544.   fcpPicture   = fcpDivisor*fcPicture;
  545.   fcpNumeric   = fcpDivisor*fcNumeric;
  546.  
  547.   {Field type IDs for simple fields}
  548.   fidSimpleString    = fcpSimple+fsubString;
  549.   fidSimpleChar      = fcpSimple+fsubChar;
  550.   fidSimpleBoolean   = fcpSimple+fsubBoolean;
  551.   fidSimpleYesNo     = fcpSimple+fsubYesNo;
  552.   fidSimpleLongInt   = fcpSimple+fsubLongInt;
  553.   fidSimpleWord      = fcpSimple+fsubWord;
  554.   fidSimpleInteger   = fcpSimple+fsubInteger;
  555.   fidSimpleByte      = fcpSimple+fsubByte;
  556.   fidSimpleShortInt  = fcpSimple+fsubShortInt;
  557.   fidSimpleReal      = fcpSimple+fsubReal;
  558.   fidSimpleExtended  = fcpSimple+fsubExtended;
  559.   fidSimpleDouble    = fcpSimple+fsubDouble;
  560.   fidSimpleSingle    = fcpSimple+fsubSingle;
  561.   fidSimpleComp      = fcpSimple+fsubComp;
  562.  
  563.   {Field type IDs for picture fields}
  564.   fidPictureString   = fcpPicture+fsubString;
  565.   fidPictureChar     = fcpPicture+fsubChar;
  566.   fidPictureBoolean  = fcpPicture+fsubBoolean;
  567.   fidPictureYesNo    = fcpPicture+fsubYesNo;
  568.   fidPictureLongInt  = fcpPicture+fsubLongInt;
  569.   fidPictureWord     = fcpPicture+fsubWord;
  570.   fidPictureInteger  = fcpPicture+fsubInteger;
  571.   fidPictureByte     = fcpPicture+fsubByte;
  572.   fidPictureShortInt = fcpPicture+fsubShortInt;
  573.   fidPictureReal     = fcpPicture+fsubReal;
  574.   fidPictureExtended = fcpPicture+fsubExtended;
  575.   fidPictureDouble   = fcpPicture+fsubDouble;
  576.   fidPictureSingle   = fcpPicture+fsubSingle;
  577.   fidPictureComp     = fcpPicture+fsubComp;
  578.   fidPictureDate     = fcpPicture+fsubDate;
  579.   fidPictureTime     = fcpPicture+fsubTime;
  580.  
  581.   {Field type IDs for numeric fields}
  582.   fidNumericLongInt  = fcpNumeric+fsubLongInt;
  583.   fidNumericWord     = fcpNumeric+fsubWord;
  584.   fidNumericInteger  = fcpNumeric+fsubInteger;
  585.   fidNumericByte     = fcpNumeric+fsubByte;
  586.   fidNumericShortInt = fcpNumeric+fsubShortInt;
  587.   fidNumericReal     = fcpNumeric+fsubReal;
  588.   fidNumericExtended = fcpNumeric+fsubExtended;
  589.   fidNumericDouble   = fcpNumeric+fsubDouble;
  590.   fidNumericSingle   = fcpNumeric+fsubSingle;
  591.   fidNumericComp     = fcpNumeric+fsubComp;
  592.  
  593.  
  594. function GetOrphStr(Index : Word) : string;
  595.   {-return a string from our RCDATA string resource}
  596.  
  597.  
  598. implementation
  599.  
  600.  
  601. var
  602.   OrphStr : TOvcStringResource;
  603.  
  604. function GetOrphStr(Index : Word) : string;
  605. begin
  606.   Result := OrphStr[Index];
  607. end;
  608.  
  609.  
  610. procedure InitAlphaCharSet;
  611.   {-Initialize AlphaOnlySet}
  612. var
  613.   C : AnsiChar;
  614. begin
  615.   AlphaCharSet  := ['A'..'Z', 'a'..'z', ' ', '-', '.', ','];
  616.   for C := #128 to #255 do
  617.     {ask windows what other characters are considered alphas}
  618.     if IsCharAlpha(C) then
  619.       AlphaCharSet := AlphaCharSet + [C];
  620. end;
  621.  
  622.  
  623. procedure FreeOrphStr; far;
  624. begin
  625.   OrphStr.Free;
  626. end;
  627.  
  628.  
  629. initialization
  630.   InitAlphaCharSet;
  631.  
  632.   OrphStr := TOvcStringResource.Create(HInstance, 'ORPHEUS3_STRINGS_ENGLISH');
  633.  
  634. {$IFDEF Win32}
  635. finalization
  636.   FreeOrphStr;
  637. {$ELSE}
  638.   AddExitProc(FreeOrphStr);
  639. {$ENDIF}
  640. end.
  641.